<?php
use tpfcore\Core;
?>
<!doctype html>
<html>

<head>
    <title>网店设置</title>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
		<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js">
		</script>
	<![endif]-->
    <link href="{$admin_assets_path}/layui/css/layui.css" rel="stylesheet" />
    <link href="{$admin_assets_path}/css/theme.min.css" rel="stylesheet">
    <link href="{$admin_assets_path}/css/simplebootadmin.css" rel="stylesheet">
    <link href="{$admin_assets_path}/css/default.css" rel="stylesheet" />
    <link href="{$admin_assets_path}/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <style>
    .length_3 {
        width: 180px;
    }

    form .input-order {
        margin-bottom: 0px;
        padding: 3px;
        width: 40px;
    }

    .table-actions {
        margin-top: 5px;
        margin-bottom: 5px;
        padding: 0px;
    }

    .table-list {
        margin-bottom: 0px;
    }
    .table-label label{display: inline-block;}
    #goods_imgs{overflow: hidden; text-align: center;}
    #goods_imgs img{width: 100%; height: auto;max-height: 120px; }
    #goods_imgs .item{width: 120px;float: left; border:1px #eaeaea solid; padding: 4px; margin-right:10px; margin-bottom: 10px; height: 170px;}
    #goods_imgs .item a:nth-child(2){display: block; height: 120px;line-height: 120px;}
    #goods_imgs input{width: 100%; box-sizing: border-box; height: 30px;}
    </style>
    <!--[if IE 7]>
		<link rel="stylesheet" href="{$admin_assets_path}/css/font-awesome-ie7.min.css">
	<![endif]-->
    <script type="text/javascript">
    //全局变量
    var GV = {
        WEB_ROOT: "",
        DIMAUB: "/",
        JS_ROOT: "/theme/backend/assets/js/",
        TOKEN: ""
    };
    </script>
    <!-- Le javascript==================================================-
	-> <!-- Placed at the end of the document so the pages load faster -->
    <script src="{$admin_assets_path}/js/jquery.js"></script>
    <script src="{$admin_assets_path}/js/wind.js"></script>
    <script src="{$admin_assets_path}/js/bootstrap.min.js"></script>
    <link href="{$admin_assets_path}/kindeditor/themes/default/default.css" rel="stylesheet" />
    <script src="{$admin_assets_path}/kindeditor/kindeditor-min.js"></script>
    <script src="{$admin_assets_path}/kindeditor/lang/zh_CN.js"></script>
    <script src="{$admin_assets_path}/layui/layui.all.js"></script>
    <script type="text/javascript">
    KindEditor.ready(function(K) {
        var editor = K.editor({
            allowFileManager : true,
            dirName : 'data/uploads',
            uploadJson:'{:Core::addons_url("kindeditor://Editor/pictureUpload")}',
            fileManagerJson:'{:url("Kindeditor/Kindeditor/file_manage")}'
        });
        K('.uploadLogo').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                    viewType : 'LIST',
                    dirName : 'data/uploads',
                    clickFn : function(url, title, width, height, border, align) {
                        editor.hideDialog();
                        $("#logo").val(url);
                        $("#logo_img_show").attr("src",url).show();
                    }
                });
            });
        });
        K('.default_goods_img').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                    viewType : 'LIST',
                    dirName : 'data/uploads',
                    clickFn : function(url, title, width, height, border, align) {
                        editor.hideDialog();
                        $("#default_goods_img").val(url);
                        $("#default_goods_img_show").attr("src",url).show();
                    }
                });
            });
        });
    });
    </script>
</head>

<body>
		<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#A" data-toggle="tab">网店信息</a></li>
			<li><a href="#B" data-toggle="tab">基本设置</a></li>
			<li><a href="#C" data-toggle="tab">显示设置</a></li>
		</ul>
		<form class="form-horizontal js-ajax-form" action="" method="post">
			<input type="hidden" name="id" value="{$list.id|default=0}"/>
			<input type="hidden" name="sign" value="shop_config"/>
			<fieldset>
				<div class="tabbable">
					<div class="tab-content">
						<div class="tab-pane active" id="A">
							<fieldset>
								<div class="control-group">
									<label class="control-label">商店标题</label>
									<div class="controls">
										<input type="text" name="options[shop_name]" style="width: 500px;" value="{$list.options.shop_name|default='TPFShop演示站'}"><span class="form-required">*</span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商店描述</label>
									<div class="controls">
										<input type="text" name="options[shop_desc]" value="{$list.options.shop_desc|default='TPFShop演示站'}"><span class="form-required">*</span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商店关键字</label>
									<div class="controls">
										<input type="text" name="options[keywords]" value="{$list.options.keywords|default='TPFrame,TPFshop,shop演示'}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">详细地址</label>
									<div class="controls">
										<input type="text" name="options[address]" value="{$list.options.address|default=''}" placeholder="详细地址">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">客服QQ号码</label>
									<div class="controls">
										<input type="text" name="options[qq]" value="{$list.options.qq|default=''}" placeholder="客服QQ号码">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">淘宝旺旺</label>
									<div class="controls">
										<input type="text" name="options[ww]" value="{$list.options.ww|default=''}" placeholder="淘宝旺旺">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">客服邮件地址</label>
									<div class="controls">
										<input type="text" name="options[service_email]" value="{$list.options.service_email|default='510974211@qq.com'}" placeholder="客服邮件地址">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">客服电话</label>
									<div class="controls">
										<input type="text" name="options[service_phone]" value="{$list.options.service_phone|default='40002356985'}" placeholder="客服电话">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商店 Logo</label>
									<div class="controls">
										<input type="hidden" name="options[logo]" id="logo" value="{$list.options.logo|default=''}" />
										<input type="button" class="uploadLogo" value="上传商店LOGO" />
										{empty name="list.options.logo"}
										<img src="" id="logo_img_show" style="width: 100px; height: 50px; display: none;">
										{else/}
										<img src="{$list.options.logo}" id="logo_img_show" style="width: 100px; height: 50px;">
										{/empty}
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">是否关闭注册</label>
									<div class="controls">
										{notpresent name="list.options.close_reg"}
										<input type="radio" name="options[close_reg]" value="1" checked>是
										<input type="radio" name="options[close_reg]" value="0">否
										{else/}
										<input type="radio" name="options[close_reg]" value="1" {eq name="list.options.close_reg" value="1"}checked="checked"{/eq}>是
										<input type="radio" name="options[close_reg]" value="0" {eq name="list.options.close_reg" value="0"}checked="checked"{/eq}>否
										{/notpresent}
									</div>
								</div>
							</fieldset>
						</div>
						<div class="tab-pane" id="B">
							<fieldset>
								<div class="control-group">
									<label class="control-label">市场价格比例</label>
									<div class="controls">
										<input type="text" name="options[market_price_ratio]" value="{$list.options.market_price_ratio|default='1.2'}" placeholder="市场价格比例">
										市场价相对于“本店售价”倍率，必须大于等于1
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">消费积分名称</label>
									<div class="controls">
										<input type="text" name="options[integral_name]" value="{$list.options.integral_name|default='积分'}" placeholder="消费积分名称">
										您可以将消费积分重新命名。例如：房呗
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">积分换算比例</label>
									<div class="controls">
										<input type="text" name="options[integral_ratio]" value="{$list.options.integral_ratio|default='1'}" placeholder="积分换算比例">
										每100积分可抵多少元现金
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">是否使用积分购买商品</label>
									<div class="controls">
										{notpresent name="list.options.is_allow_integral"}
										<input type="radio" name="options[is_allow_integral]" value="1" checked>可以使用
										<input type="radio" name="options[is_allow_integral]" value="0">不可以使用
										{else/}
										<input type="radio" name="options[is_allow_integral]" value="1" {eq name="list.options.is_allow_integral" value="1"}checked="checked"{/eq}>可以使用
										<input type="radio" name="options[is_allow_integral]" value="0" {eq name="list.options.is_allow_integral" value="0"}checked="checked"{/eq}>不可以使用
										{/notpresent}
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商品货号前缀</label>
									<div class="controls">
										<input type="text" name="options[sn_prefix]" value="{$list.options.sn_prefix|default='TPF'}" placeholder="商品货号前缀">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">用户评论是否需要审核</label>
									<div class="controls">
										{notpresent name="list.options.comment_ischeck"}
										<input type="radio" name="options[comment_ischeck]" value="1" checked>须要审核
										<input type="radio" name="options[comment_ischeck]" value="0">不须要审核
										{else/}
										<input type="radio" name="options[comment_ischeck]" value="1" {eq name="list.options.comment_ischeck" value="1"}checked="checked"{/eq}>须要审核
										<input type="radio" name="options[comment_ischeck]" value="0" {eq name="list.options.comment_ischeck" value="0"}checked="checked"{/eq}>不须要审核
										{/notpresent}
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商品的默认图片</label>
									<div class="controls">
										<input type="hidden" id="default_goods_img" name="options['default_goods_img']" value="{$list.options.default_goods_img|default=''}">
										<input type="button" class="default_goods_img" value="上传商品默认图片"/>
										{empty name="list.options.default_goods_img"}
										<img src="" id="default_goods_img_show" style="width: 100px; height: 50px; display: none;">
										{else/}
										<img src="{$list.options.default_goods_img}" id="default_goods_img_show" style="width: 100px; height: 50px;">
										{/empty}
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">会员注册赠送积分</label>
									<div class="controls">
										<input type="text" name="options[reg_in_integral]" value="{$list.options.reg_in_integral|default='0'}" placeholder="会员注册赠送积分">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">默认库存</label>
									<div class="controls">
										<input type="text" name="options[default_stock]" value="{$list.options.default_stock|default='1'}" placeholder="默认库存">
									</div>
								</div>
							</fieldset>
						</div>
						<div class="tab-pane" id="C">
							<fieldset>
								<div class="control-group">
									<label class="control-label">缩略图宽度</label>
									<div class="controls">
										<input type="text" name="options[thumb_width]" value="{$list.options.thumb_width|default='100'}" placeholder="缩略图宽度">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">缩略图高度</label>
									<div class="controls">
										<input type="text" name="options[thumb_height]" value="{$list.options.thumb_height|default='100'}" placeholder="缩略图高度">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商品图片宽度</label>
									<div class="controls">
										<input type="text" name="options[goods_img_width]" value="{$list.options.goods_img_width|default='300'}" placeholder="商品图片宽度">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商品图片高度</label>
									<div class="controls">
										<input type="text" name="options[goods_img_height]" value="{$list.options.goods_img_height|default='300'}" placeholder="缩略图宽度">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">商品图片最大上传数量</label>
									<div class="controls">
										<input type="text" name="options[max_upload_goods_photo]" value="{$list.options.max_upload_goods_photo|default='10'}" placeholder="商品图片最大上传数量">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">是否显示市场价格</label>
									<div class="controls">
										{notpresent name="list.options.show_market_price"}
										<input type="radio" name="options[show_market_price]" value="1" checked>显示
										<input type="radio" name="options[show_market_price]" value="0">不显示
										{else/}
										<input type="radio" name="options[show_market_price]" value="1" {eq name="list.options.show_market_price" value="1"}checked="checked"{/eq}>显示
										<input type="radio" name="options[show_market_price]" value="0" {eq name="list.options.show_market_price" value="0"}checked="checked"{/eq}>不显示
										{/notpresent}
									</div>
								</div>
							</fieldset>
						</div>
					</div>
				</div>

				<div class="form-actions">
					<button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
				</div>
			</fieldset>
		</form>

	</div>
	<script src="{$admin_assets_path}/js/common.js"></script>
</body>
</html>